package com.six.JacksonOperation;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.six.entity.Person;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * ClassName:JsonToJava
 * Package:com.six
 * Description
 *
 * @Author:@wenxueshi
 * @Create:2023/7/27 - 22:48
 * @Version:v1.0
 */
//JSON字节输入流-->Java对象
public class JsonToJava3 {

    public static void main(String[] args) throws IOException {
        FileInputStream in = new FileInputStream("src/test2.json");
        ObjectMapper objectMapper = new ObjectMapper();
        Person person = objectMapper.readValue(in, Person.class);
        //Person(name=zxy, age=66, skillsList=[java, python])
        System.out.println(person);
    }
}
